def equal(s1,s2):
    if len(s1)!=len(s2) :
        return False

    for i in xrange(len(s1)):
        if s1[i]!=s2[i] :
            return False
    else :
        return True
    
    i = 0
    while i<len(s1) and s1[i]==s2[i] :
        i += 1
    return i>=len(s1)

def main():
    s1 = raw_input()
    s2 = raw_input()
    if equal(s1,s2) :
        print 'Yes'
    else :
        print 'No'

if __name__ == '__main__' :
    main()
